home *** CD-ROM | disk | FTP | other *** search
/ Computer Arts: Pro Software Skills - Photoshop / Computer Arts Pro Software Skills Photoshop.iso / pc / main.swf / scripts / __Packages / mx / video / FLVPlayback.as < prev    next >
Encoding:
Text File  |  2011-06-06  |  49.2 KB  |  1,707 lines

  1. class mx.video.FLVPlayback extends MovieClip
  2. {
  3.    var _autoPlay;
  4.    var _autoRewind;
  5.    var _autoSize;
  6.    var _bufferTime;
  7.    var _contentPath;
  8.    var _cuePoints;
  9.    var _idleTimeout;
  10.    var _isLive;
  11.    var _aspectRatio;
  12.    var _seekToPrevOffset;
  13.    var _playheadUpdateInterval;
  14.    var _progressInterval;
  15.    var _totalTime;
  16.    var _transform;
  17.    var _volume;
  18.    var _skinAutoHide;
  19.    var _bufferingBarHides;
  20.    var _origHeight;
  21.    var __height;
  22.    var _origWidth;
  23.    var __width;
  24.    var _scaleX;
  25.    var _scaleY;
  26.    var _preSeekTime;
  27.    var _firstStreamReady;
  28.    var _firstStreamShown;
  29.    var _activeVP;
  30.    var _visibleVP;
  31.    var _topVP;
  32.    var _vp;
  33.    var _vpState;
  34.    var _cpMgr;
  35.    var boundingBox_mc;
  36.    var preview_mc;
  37.    var dispatchEvent;
  38.    var _uiMgr;
  39.    var _bufferingBar;
  40.    var _backButton;
  41.    var _forwardButton;
  42.    var _muteButton;
  43.    var _pauseButton;
  44.    var _playButton;
  45.    var _playPauseButton;
  46.    var _seekBar;
  47.    var _seekBarInterval;
  48.    var _seekBarScrubTolerance;
  49.    var _skin;
  50.    var _stopButton;
  51.    var _volumeBar;
  52.    var _volumeBarInterval;
  53.    var _volumeBarScrubTolerance;
  54.    static var version = "1.0.2.7";
  55.    static var shortVersion = "1.0.2";
  56.    static var DISCONNECTED = "disconnected";
  57.    static var STOPPED = "stopped";
  58.    static var PLAYING = "playing";
  59.    static var PAUSED = "paused";
  60.    static var BUFFERING = "buffering";
  61.    static var LOADING = "loading";
  62.    static var CONNECTION_ERROR = "connectionError";
  63.    static var REWINDING = "rewinding";
  64.    static var SEEKING = "seeking";
  65.    static var ALL = "all";
  66.    static var EVENT = "event";
  67.    static var NAVIGATION = "navigation";
  68.    static var FLV = "flv";
  69.    static var ACTIONSCRIPT = "actionscript";
  70.    static var VP_DEPTH_OFFSET = 100;
  71.    static var SEEK_TO_PREV_OFFSET_DEFAULT = 1;
  72.    function FLVPlayback()
  73.    {
  74.       super();
  75.       mx.events.EventDispatcher.initialize(this);
  76.       if(this._autoPlay == undefined)
  77.       {
  78.          this._autoPlay = true;
  79.       }
  80.       if(this._autoRewind == undefined)
  81.       {
  82.          this._autoRewind = true;
  83.       }
  84.       if(this._autoSize == undefined)
  85.       {
  86.          this._autoSize = false;
  87.       }
  88.       if(this._bufferTime == undefined)
  89.       {
  90.          this._bufferTime = 0.1;
  91.       }
  92.       if(this._contentPath == undefined)
  93.       {
  94.          this._contentPath = "";
  95.       }
  96.       if(this._cuePoints == undefined)
  97.       {
  98.          this._cuePoints = null;
  99.       }
  100.       if(this._idleTimeout == undefined)
  101.       {
  102.          this._idleTimeout = mx.video.VideoPlayer.DEFAULT_IDLE_TIMEOUT_INTERVAL;
  103.       }
  104.       if(this._isLive == undefined)
  105.       {
  106.          this._isLive = false;
  107.       }
  108.       if(this._aspectRatio == undefined)
  109.       {
  110.          this._aspectRatio = true;
  111.       }
  112.       if(this._seekToPrevOffset == undefined)
  113.       {
  114.          this._seekToPrevOffset = mx.video.FLVPlayback.SEEK_TO_PREV_OFFSET_DEFAULT;
  115.       }
  116.       if(this._playheadUpdateInterval == undefined)
  117.       {
  118.          this._playheadUpdateInterval = mx.video.VideoPlayer.DEFAULT_UPDATE_PROGRESS_INTERVAL;
  119.       }
  120.       if(this._progressInterval == undefined)
  121.       {
  122.          this._progressInterval = mx.video.VideoPlayer.DEFAULT_UPDATE_TIME_INTERVAL;
  123.       }
  124.       if(this._totalTime == undefined)
  125.       {
  126.          this._totalTime = 0;
  127.       }
  128.       if(this._transform == undefined)
  129.       {
  130.          this._transform = null;
  131.       }
  132.       if(this._volume == undefined)
  133.       {
  134.          this._volume = 100;
  135.       }
  136.       if(this._skinAutoHide == undefined)
  137.       {
  138.          this._skinAutoHide = false;
  139.       }
  140.       if(this._bufferingBarHides == undefined)
  141.       {
  142.          this._bufferingBarHides = false;
  143.       }
  144.       this._origHeight = this.__height = this._height;
  145.       this._origWidth = this.__width = this._width;
  146.       this._scaleX = 100;
  147.       this._scaleY = 100;
  148.       this._xscale = 100;
  149.       this._yscale = 100;
  150.       this._preSeekTime = -1;
  151.       this._firstStreamReady = false;
  152.       this._firstStreamShown = false;
  153.       this.createUIManager();
  154.       this._activeVP = 0;
  155.       this._visibleVP = 0;
  156.       this._topVP = 0;
  157.       this._vp = new Array();
  158.       this._vpState = new Array();
  159.       this._cpMgr = new Array();
  160.       this.createVideoPlayer(0);
  161.       this._vp[0].visible = false;
  162.       this._vp[0].volume = 0;
  163.       this.boundingBox_mc._visible = false;
  164.       this.boundingBox_mc.unloadMovie();
  165.       delete this.boundingBox_mc;
  166.       if(_global.isLivePreview)
  167.       {
  168.          this.createLivePreviewMovieClip();
  169.          this.setSize(this.__width,this.__height);
  170.       }
  171.       this._cpMgr[0].processCuePointsProperty(this._cuePoints);
  172.       delete this._cuePoints;
  173.       this._cuePoints = null;
  174.    }
  175.    function setSize(w, h)
  176.    {
  177.       if(_global.isLivePreview)
  178.       {
  179.          if(this.preview_mc == undefined)
  180.          {
  181.             this.createLivePreviewMovieClip();
  182.          }
  183.          this.preview_mc.box_mc._width = w;
  184.          this.preview_mc.box_mc._height = h;
  185.          if(this.preview_mc.box_mc._width < this.preview_mc.icon_mc._width || this.preview_mc.box_mc._height < this.preview_mc.icon_mc._height)
  186.          {
  187.             this.preview_mc.icon_mc._visible = false;
  188.          }
  189.          else
  190.          {
  191.             this.preview_mc.icon_mc._visible = true;
  192.             this.preview_mc.icon_mc._x = (this.preview_mc.box_mc._width - this.preview_mc.icon_mc._width) / 2;
  193.             this.preview_mc.icon_mc._y = (this.preview_mc.box_mc._height - this.preview_mc.icon_mc._height) / 2;
  194.          }
  195.       }
  196.       if(w == this.width && h == this.height)
  197.       {
  198.          return undefined;
  199.       }
  200.       this.__width = w;
  201.       this.__height = h;
  202.       var _loc3_ = 0;
  203.       while(_loc3_ < this._vp.length)
  204.       {
  205.          if(this._vp[_loc3_] != undefined)
  206.          {
  207.             this._vp[_loc3_].setSize(w,h);
  208.          }
  209.          _loc3_ = _loc3_ + 1;
  210.       }
  211.       this.dispatchEvent({type:"resize",x:this.x,y:this.y,width:w,height:h});
  212.    }
  213.    function setScale(xs, ys)
  214.    {
  215.       if(xs == this.scaleX && ys == this.scaleY)
  216.       {
  217.          return undefined;
  218.       }
  219.       this._scaleX = xs;
  220.       this._scaleY = ys;
  221.       var _loc2_ = 0;
  222.       while(_loc2_ < this._vp.length)
  223.       {
  224.          if(this._vp[_loc2_] != undefined)
  225.          {
  226.             this._vp[_loc2_].setSize(this._origWidth * xs / 100,this._origHeight * ys / 100);
  227.          }
  228.          _loc2_ = _loc2_ + 1;
  229.       }
  230.       this.dispatchEvent({type:"resize",x:this.x,y:this.y,width:this.width,height:this.height});
  231.    }
  232.    function handleEvent(e)
  233.    {
  234.       var _loc3_ = e.state;
  235.       if(e.state != undefined && e.target._name == this._visibleVP && this.scrubbing)
  236.       {
  237.          _loc3_ = mx.video.FLVPlayback.SEEKING;
  238.       }
  239.       if(e.type == "metadataReceived")
  240.       {
  241.          this._cpMgr[e.target._name].processFLVCuePoints(e.info.cuePoints);
  242.          this.dispatchEvent({type:e.type,info:e.info,vp:e.target._name});
  243.       }
  244.       else if(e.type == "cuePoint")
  245.       {
  246.          if(this._cpMgr[e.target._name].isFLVCuePointEnabled(e.info))
  247.          {
  248.             this.dispatchEvent({type:e.type,info:e.info,vp:e.target._name});
  249.          }
  250.       }
  251.       else if(e.type == "rewind")
  252.       {
  253.          this.dispatchEvent({type:e.type,auto:true,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  254.          this._cpMgr[e.target._name].resetASCuePointIndex(e.playheadTime);
  255.       }
  256.       else if(e.type == "resize")
  257.       {
  258.          this.dispatchEvent({type:e.type,x:this.x,y:this.y,width:this.width,height:this.height,auto:true,vp:e.target._name});
  259.       }
  260.       else if(e.type == "playheadUpdate")
  261.       {
  262.          this.dispatchEvent({type:e.type,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  263.          if(this._preSeekTime >= 0 && e.target.state != mx.video.FLVPlayback.SEEKING)
  264.          {
  265.             var _loc5_ = this._preSeekTime;
  266.             this._preSeekTime = -1;
  267.             this._cpMgr[e.target._name].resetASCuePointIndex(e.playheadTime);
  268.             this.dispatchEvent({type:"seek",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  269.             if(_loc5_ < e.playheadTime)
  270.             {
  271.                this.dispatchEvent({type:"fastForward",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  272.             }
  273.             else if(_loc5_ > e.playheadTime)
  274.             {
  275.                this.dispatchEvent({type:"rewind",auto:false,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  276.             }
  277.          }
  278.          this._cpMgr[e.target._name].dispatchASCuePoints();
  279.       }
  280.       else if(e.type == "stateChange")
  281.       {
  282.          var _loc4_ = e.target._name;
  283.          if(_loc4_ == this._visibleVP && this.scrubbing)
  284.          {
  285.             return undefined;
  286.          }
  287.          if(e.state == mx.video.VideoPlayer.RESIZING)
  288.          {
  289.             return undefined;
  290.          }
  291.          if(this._vpState[_loc4_].prevState == mx.video.FLVPlayback.LOADING && this._vpState[_loc4_].autoPlay && e.state == mx.video.FLVPlayback.STOPPED)
  292.          {
  293.             return undefined;
  294.          }
  295.          this._vpState[_loc4_].prevState = e.state;
  296.          this.dispatchEvent({type:e.type,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  297.          if(this._vp[e.target._name].state != _loc3_)
  298.          {
  299.             return undefined;
  300.          }
  301.          switch(_loc3_)
  302.          {
  303.             case mx.video.FLVPlayback.BUFFERING:
  304.                this.dispatchEvent({type:"buffering",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  305.                break;
  306.             case mx.video.FLVPlayback.PAUSED:
  307.                this.dispatchEvent({type:"paused",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  308.                break;
  309.             case mx.video.FLVPlayback.PLAYING:
  310.                this.dispatchEvent({type:"playing",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  311.                break;
  312.             case mx.video.FLVPlayback.STOPPED:
  313.                this.dispatchEvent({type:"stopped",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  314.          }
  315.       }
  316.       else if(e.type == "progress")
  317.       {
  318.          this.dispatchEvent({type:e.type,bytesLoaded:e.bytesLoaded,bytesTotal:e.bytesTotal,vp:e.target._name});
  319.       }
  320.       else if(e.type == "ready")
  321.       {
  322.          _loc4_ = e.target._name;
  323.          if(!this._firstStreamReady)
  324.          {
  325.             if(_loc4_ == this._visibleVP)
  326.             {
  327.                this._firstStreamReady = true;
  328.                if(this._uiMgr.skinReady && !this._firstStreamShown)
  329.                {
  330.                   this._uiMgr.visible = true;
  331.                   this.showFirstStream();
  332.                }
  333.             }
  334.          }
  335.          else if(this._firstStreamShown && _loc3_ == mx.video.FLVPlayback.STOPPED && this._vpState[_loc4_].autoPlay)
  336.          {
  337.             this._vp[_loc4_].play();
  338.          }
  339.          this.dispatchEvent({type:e.type,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  340.       }
  341.       else if(e.type == "close" || e.type == "complete")
  342.       {
  343.          this.dispatchEvent({type:e.type,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  344.       }
  345.    }
  346.    function load(contentPath, totalTime, isLive)
  347.    {
  348.       if(this._vp[this._activeVP] == undefined)
  349.       {
  350.          return undefined;
  351.       }
  352.       if(contentPath == null || contentPath == "")
  353.       {
  354.          return undefined;
  355.       }
  356.       this.autoPlay = false;
  357.       if(totalTime != undefined)
  358.       {
  359.          this.totalTime = totalTime;
  360.       }
  361.       if(isLive != undefined)
  362.       {
  363.          this.isLive = isLive;
  364.       }
  365.       this.contentPath = contentPath;
  366.    }
  367.    function play(contentPath, totalTime, isLive)
  368.    {
  369.       if(this._vp[this._activeVP] == undefined)
  370.       {
  371.          return undefined;
  372.       }
  373.       if(contentPath == undefined)
  374.       {
  375.          this._vp[this._activeVP].play();
  376.       }
  377.       else
  378.       {
  379.          this.autoPlay = true;
  380.          if(totalTime != undefined)
  381.          {
  382.             this.totalTime = totalTime;
  383.          }
  384.          if(isLive != undefined)
  385.          {
  386.             this.isLive = isLive;
  387.          }
  388.          this.contentPath = contentPath;
  389.       }
  390.    }
  391.    function pause()
  392.    {
  393.       if(this._vp[this._activeVP] == undefined)
  394.       {
  395.          return undefined;
  396.       }
  397.       this._vp[this._activeVP].pause();
  398.    }
  399.    function stop()
  400.    {
  401.       if(this._vp[this._activeVP] == undefined)
  402.       {
  403.          return undefined;
  404.       }
  405.       this._vp[this._activeVP].stop();
  406.    }
  407.    function seek(time)
  408.    {
  409.       if(this._vp[this._activeVP] == undefined)
  410.       {
  411.          return undefined;
  412.       }
  413.       this._preSeekTime = this.playheadTime;
  414.       this._vp[this._activeVP].seek(time);
  415.    }
  416.    function seekSeconds(time)
  417.    {
  418.       this.seek(time);
  419.    }
  420.    function seekPercent(percent)
  421.    {
  422.       if(this._vp[this._activeVP] == undefined)
  423.       {
  424.          return undefined;
  425.       }
  426.       if(percent < 0 || percent > 100 || this._vp[this._activeVP].totalTime == null || this._vp[this._activeVP].totalTime <= 0)
  427.       {
  428.          throw new mx.video.VideoError(mx.video.VideoError.INVALID_SEEK);
  429.       }
  430.       this.seek(this._vp[this._activeVP].totalTime * percent / 100);
  431.    }
  432.    function get playheadPercentage()
  433.    {
  434.       if(this._vp[this._activeVP].totalTime == null || this._vp[this._activeVP].totalTime <= 0)
  435.       {
  436.          return undefined;
  437.       }
  438.       return this._vp[this._activeVP].playheadTime / this._vp[this._activeVP].totalTime * 100;
  439.    }
  440.    function set playheadPercentage(percent)
  441.    {
  442.       this.seekPercent(percent);
  443.    }
  444.    function seekToNavCuePoint(timeNameOrCuePoint)
  445.    {
  446.       var _loc3_ = undefined;
  447.       switch(typeof timeNameOrCuePoint)
  448.       {
  449.          case "string":
  450.             _loc3_ = {name:timeNameOrCuePoint};
  451.             break;
  452.          case "number":
  453.             _loc3_ = {time:timeNameOrCuePoint};
  454.             break;
  455.          case "object":
  456.             _loc3_ = timeNameOrCuePoint;
  457.       }
  458.       if(_loc3_.name == null || typeof _loc3_.name != "string")
  459.       {
  460.          this.seekToNextNavCuePoint(_loc3_.time);
  461.          return undefined;
  462.       }
  463.       if(isNaN(_loc3_.time))
  464.       {
  465.          _loc3_.time = 0;
  466.       }
  467.       var _loc2_ = this.findNearestCuePoint(timeNameOrCuePoint,mx.video.FLVPlayback.NAVIGATION);
  468.       while(_loc2_ != null && (_loc2_.time < _loc3_.time || !this.isFLVCuePointEnabled(_loc2_)))
  469.       {
  470.          _loc2_ = this.findNextCuePointWithName(_loc2_);
  471.       }
  472.       if(_loc2_ == null)
  473.       {
  474.          throw new mx.video.VideoError(mx.video.VideoError.INVALID_SEEK);
  475.       }
  476.       this.seek(_loc2_.time);
  477.    }
  478.    function seekToNextNavCuePoint(time)
  479.    {
  480.       if(this._vp[this._activeVP] == undefined)
  481.       {
  482.          return undefined;
  483.       }
  484.       if(isNaN(time) || time < 0)
  485.       {
  486.          time = this._vp[this._activeVP].playheadTime + 0.001;
  487.       }
  488.       var _loc3_ = undefined;
  489.       _loc3_ = this.findNearestCuePoint(time,mx.video.FLVPlayback.NAVIGATION);
  490.       if(_loc3_ == null)
  491.       {
  492.          this.seek(this._vp[this._activeVP].totalTime);
  493.          return undefined;
  494.       }
  495.       var _loc2_ = _loc3_.index;
  496.       if(_loc3_.time < time)
  497.       {
  498.          _loc2_ = _loc2_ + 1;
  499.       }
  500.       while(_loc2_ < _loc3_.array.length && !this.isFLVCuePointEnabled(_loc3_.array[_loc2_]))
  501.       {
  502.          _loc2_ = _loc2_ + 1;
  503.       }
  504.       if(_loc2_ >= _loc3_.array.length)
  505.       {
  506.          var _loc5_ = this._vp[this._activeVP].totalTime;
  507.          if(_loc3_.array[_loc3_.array.length - 1].time > _loc5_)
  508.          {
  509.             _loc5_ = _loc3_.array[_loc3_.array.length - 1];
  510.          }
  511.          this.seek(_loc5_);
  512.       }
  513.       else
  514.       {
  515.          this.seek(_loc3_.array[_loc2_].time);
  516.       }
  517.    }
  518.    function seekToPrevNavCuePoint(time)
  519.    {
  520.       if(this._vp[this._activeVP] == undefined)
  521.       {
  522.          return undefined;
  523.       }
  524.       if(isNaN(time) || time < 0)
  525.       {
  526.          time = this._vp[this._activeVP].playheadTime;
  527.       }
  528.       var _loc3_ = this.findNearestCuePoint(time,mx.video.FLVPlayback.NAVIGATION);
  529.       if(_loc3_ == null)
  530.       {
  531.          this.seek(0);
  532.          return undefined;
  533.       }
  534.       var _loc2_ = _loc3_.index;
  535.       while(_loc2_ >= 0 && (!this.isFLVCuePointEnabled(_loc3_.array[_loc2_]) || _loc3_.array[_loc2_].time >= time - this._seekToPrevOffset))
  536.       {
  537.          _loc2_ = _loc2_ - 1;
  538.       }
  539.       if(_loc2_ < 0)
  540.       {
  541.          this.seek(0);
  542.       }
  543.       else
  544.       {
  545.          this.seek(_loc3_.array[_loc2_].time);
  546.       }
  547.    }
  548.    function addASCuePoint(timeOrCuePoint, name, parameters)
  549.    {
  550.       return this._cpMgr[this._activeVP].addASCuePoint(timeOrCuePoint,name,parameters);
  551.    }
  552.    function removeASCuePoint(timeNameOrCuePoint)
  553.    {
  554.       return this._cpMgr[this._activeVP].removeASCuePoint(timeNameOrCuePoint);
  555.    }
  556.    function findCuePoint(timeNameOrCuePoint, type)
  557.    {
  558.       switch(type)
  559.       {
  560.          case "event":
  561.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].eventCuePoints,false,timeNameOrCuePoint);
  562.          case "navigation":
  563.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].navCuePoints,false,timeNameOrCuePoint);
  564.          case "flv":
  565.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].flvCuePoints,false,timeNameOrCuePoint);
  566.          case "actionscript":
  567.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].asCuePoints,false,timeNameOrCuePoint);
  568.          case "all":
  569.          default:
  570.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].allCuePoints,false,timeNameOrCuePoint);
  571.       }
  572.    }
  573.    function findNearestCuePoint(timeNameOrCuePoint, type)
  574.    {
  575.       switch(type)
  576.       {
  577.          case "event":
  578.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].eventCuePoints,true,timeNameOrCuePoint);
  579.          case "navigation":
  580.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].navCuePoints,true,timeNameOrCuePoint);
  581.          case "flv":
  582.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].flvCuePoints,true,timeNameOrCuePoint);
  583.          case "actionscript":
  584.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].asCuePoints,true,timeNameOrCuePoint);
  585.          case "all":
  586.          default:
  587.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].allCuePoints,true,timeNameOrCuePoint);
  588.       }
  589.    }
  590.    function findNextCuePointWithName(cuePoint)
  591.    {
  592.       return this._cpMgr[this._activeVP].getNextCuePointWithName(cuePoint);
  593.    }
  594.    function setFLVCuePointEnabled(enabled, timeNameOrCuePoint)
  595.    {
  596.       return this._cpMgr[this._activeVP].setFLVCuePointEnabled(enabled,timeNameOrCuePoint);
  597.    }
  598.    function isFLVCuePointEnabled(timeNameOrCuePoint)
  599.    {
  600.       return this._cpMgr[this._activeVP].isFLVCuePointEnabled(timeNameOrCuePoint);
  601.    }
  602.    function getNextHighestDepth()
  603.    {
  604.       var _loc2_ = super.getNextHighestDepth();
  605.       return _loc2_ >= 1000 ? _loc2_ : 1000;
  606.    }
  607.    function bringVideoPlayerToFront(index)
  608.    {
  609.       if(index == this._topVP || this._vp[index] == undefined)
  610.       {
  611.          return undefined;
  612.       }
  613.       this._vp[this._topVP].swapDepths(this._vp[index].getDepth());
  614.       this._topVP = index;
  615.    }
  616.    function getVideoPlayer(index)
  617.    {
  618.       return this._vp[index];
  619.    }
  620.    function closeVideoPlayer(index)
  621.    {
  622.       if(this._vp[index] == undefined)
  623.       {
  624.          return undefined;
  625.       }
  626.       if(index == 0)
  627.       {
  628.          throw new mx.video.VideoError(mx.video.VideoError.DELETE_DEFAULT_PLAYER);
  629.       }
  630.       if(this._visibleVP == index)
  631.       {
  632.          this.visibleVideoPlayerIndex = 0;
  633.       }
  634.       if(this._activeVP == index)
  635.       {
  636.          this.activeVideoPlayerIndex = 0;
  637.       }
  638.       this._vp[index].close();
  639.       this._vp[index].unloadMovie();
  640.       delete this._vp[index];
  641.       this._vp[index] = undefined;
  642.    }
  643.    function get activeVideoPlayerIndex()
  644.    {
  645.       return this._activeVP;
  646.    }
  647.    function set activeVideoPlayerIndex(i)
  648.    {
  649.       if(this._activeVP == i)
  650.       {
  651.          return;
  652.       }
  653.       if(this._vp[this._activeVP].onEnterFrame != undefined)
  654.       {
  655.          this.doContentPathConnect();
  656.       }
  657.       this._activeVP = i;
  658.       if(this._vp[this._activeVP] == undefined)
  659.       {
  660.          this.createVideoPlayer(this._activeVP);
  661.          this._vp[this._activeVP].visible = false;
  662.          this._vp[this._activeVP].volume = 0;
  663.       }
  664.    }
  665.    function get autoPlay()
  666.    {
  667.       if(this._vpState[this._activeVP] == undefined)
  668.       {
  669.          return this._autoPlay;
  670.       }
  671.       return this._vpState[this._activeVP].autoPlay;
  672.    }
  673.    function set autoPlay(flag)
  674.    {
  675.       if(this._activeVP == 0 || this._activeVP == undefined)
  676.       {
  677.          this._autoPlay = flag;
  678.       }
  679.       this._vpState[this._activeVP].autoPlay = flag;
  680.    }
  681.    function get autoRewind()
  682.    {
  683.       if(this._vp[this._activeVP] == undefined)
  684.       {
  685.          return this._autoRewind;
  686.       }
  687.       return this._vp[this._activeVP].autoRewind;
  688.    }
  689.    function set autoRewind(flag)
  690.    {
  691.       if(this._activeVP == 0 || this._activeVP == undefined)
  692.       {
  693.          this._autoRewind = flag;
  694.       }
  695.       this._vp[this._activeVP].autoRewind = flag;
  696.    }
  697.    function get autoSize()
  698.    {
  699.       if(this._vp[this._activeVP] == undefined)
  700.       {
  701.          return this._autoSize;
  702.       }
  703.       return this._vp[this._activeVP].autoSize;
  704.    }
  705.    function set autoSize(flag)
  706.    {
  707.       if(this._activeVP == 0 || this._activeVP == undefined)
  708.       {
  709.          this._autoSize = flag;
  710.       }
  711.       this._vp[this._activeVP].autoSize = flag;
  712.    }
  713.    function get bitrate()
  714.    {
  715.       return this.ncMgr.getBitrate();
  716.    }
  717.    function set bitrate(b)
  718.    {
  719.       this.ncMgr.setBitrate(b);
  720.    }
  721.    function get buffering()
  722.    {
  723.       if(this._vp[this._activeVP] == undefined)
  724.       {
  725.          return false;
  726.       }
  727.       return this._vp[this._activeVP].state == mx.video.FLVPlayback.BUFFERING;
  728.    }
  729.    function get bufferingBar()
  730.    {
  731.       if(this._uiMgr != null)
  732.       {
  733.          this._bufferingBar = this._uiMgr.getControl(mx.video.UIManager.BUFFERING_BAR);
  734.       }
  735.       return this._bufferingBar;
  736.    }
  737.    function set bufferingBar(s)
  738.    {
  739.       this._bufferingBar = s;
  740.       if(this._uiMgr != null)
  741.       {
  742.          this._uiMgr.setControl(mx.video.UIManager.BUFFERING_BAR,s);
  743.       }
  744.    }
  745.    function get bufferingBarHidesAndDisablesOthers()
  746.    {
  747.       if(this._uiMgr != null)
  748.       {
  749.          this._bufferingBarHides = this._uiMgr.bufferingBarHidesAndDisablesOthers;
  750.       }
  751.       return this._bufferingBarHides;
  752.    }
  753.    function set bufferingBarHidesAndDisablesOthers(b)
  754.    {
  755.       this._bufferingBarHides = b;
  756.       if(this._uiMgr != null)
  757.       {
  758.          this._uiMgr.bufferingBarHidesAndDisablesOthers = b;
  759.       }
  760.    }
  761.    function get backButton()
  762.    {
  763.       if(this._uiMgr != null)
  764.       {
  765.          this._backButton = this._uiMgr.getControl(mx.video.UIManager.BACK_BUTTON);
  766.       }
  767.       return this._backButton;
  768.    }
  769.    function set backButton(s)
  770.    {
  771.       this._backButton = s;
  772.       if(this._uiMgr != null)
  773.       {
  774.          this._uiMgr.setControl(mx.video.UIManager.BACK_BUTTON,s);
  775.       }
  776.    }
  777.    function get bufferTime()
  778.    {
  779.       if(this._vp[this._activeVP] == undefined)
  780.       {
  781.          return this._bufferTime;
  782.       }
  783.       return this._vp[this._activeVP].bufferTime;
  784.    }
  785.    function set bufferTime(aTime)
  786.    {
  787.       if(this._activeVP == 0 || this._activeVP == undefined)
  788.       {
  789.          this._bufferTime = aTime;
  790.       }
  791.       this._vp[this._activeVP].bufferTime = aTime;
  792.    }
  793.    function get bytesLoaded()
  794.    {
  795.       return this._vp[this._activeVP].bytesLoaded;
  796.    }
  797.    function get bytesTotal()
  798.    {
  799.       return this._vp[this._activeVP].bytesTotal;
  800.    }
  801.    function get contentPath()
  802.    {
  803.       if(this._vp[this._activeVP] == undefined || this._vp[this._activeVP].onEnterFrame != undefined)
  804.       {
  805.          return this._contentPath;
  806.       }
  807.       return this._vp[this._activeVP].url;
  808.    }
  809.    function set contentPath(url)
  810.    {
  811.       if(_global.isLivePreview)
  812.       {
  813.          return;
  814.       }
  815.       if(this._vp[this._activeVP] == undefined)
  816.       {
  817.          if(url == this._contentPath)
  818.          {
  819.             return;
  820.          }
  821.          this._contentPath = url;
  822.       }
  823.       else
  824.       {
  825.          if(this._vp[this._activeVP].url == url)
  826.          {
  827.             return;
  828.          }
  829.          this._vpState[this._activeVP].minProgressPercent = undefined;
  830.          if(this._vp[this._activeVP].onEnterFrame != undefined)
  831.          {
  832.             delete this._vp[this._activeVP].onEnterFrame;
  833.             this._vp[this._activeVP].onEnterFrame = undefined;
  834.          }
  835.          this._cpMgr[this._activeVP].reset();
  836.          if(this._vpState[this._activeVP].autoPlay && this._firstStreamShown)
  837.          {
  838.             this._vp[this._activeVP].play(url,this._vpState[this._activeVP].isLive,this._vpState[this._activeVP].totalTime);
  839.          }
  840.          else
  841.          {
  842.             this._vp[this._activeVP].load(url,this._vpState[this._activeVP].isLive,this._vpState[this._activeVP].totalTime);
  843.          }
  844.          this._vpState[this._activeVP].isLiveSet = false;
  845.          this._vpState[this._activeVP].totalTimeSet = false;
  846.       }
  847.    }
  848.    function set cuePoints(cp)
  849.    {
  850.       if(this._cuePoints != undefined)
  851.       {
  852.          return;
  853.       }
  854.       this._cuePoints = cp;
  855.    }
  856.    function get forwardButton()
  857.    {
  858.       if(this._uiMgr != null)
  859.       {
  860.          this._forwardButton = this._uiMgr.getControl(mx.video.UIManager.FORWARD_BUTTON);
  861.       }
  862.       return this._forwardButton;
  863.    }
  864.    function set forwardButton(s)
  865.    {
  866.       this._forwardButton = s;
  867.       if(this._uiMgr != null)
  868.       {
  869.          this._uiMgr.setControl(mx.video.UIManager.FORWARD_BUTTON,s);
  870.       }
  871.    }
  872.    function get height()
  873.    {
  874.       if(_global.isLivePreview)
  875.       {
  876.          return this.__height;
  877.       }
  878.       if(this._vp[this._visibleVP] != undefined)
  879.       {
  880.          this.__height = this._vp[this._visibleVP].height;
  881.       }
  882.       return this.__height;
  883.    }
  884.    function set height(h)
  885.    {
  886.       this.setSize(this.width,h);
  887.    }
  888.    function get idleTimeout()
  889.    {
  890.       if(this._vp[this._activeVP] == undefined)
  891.       {
  892.          return this._idleTimeout;
  893.       }
  894.       return this._vp[this._activeVP].idleTimeout;
  895.    }
  896.    function set idleTimeout(aTime)
  897.    {
  898.       if(this._activeVP == 0 || this._activeVP == undefined)
  899.       {
  900.          this._idleTimeout = aTime;
  901.       }
  902.       this._vp[this._activeVP].idleTimeout = aTime;
  903.    }
  904.    function get isRTMP()
  905.    {
  906.       if(_global.isLivePreview)
  907.       {
  908.          return true;
  909.       }
  910.       if(this._vp[this._activeVP] == undefined)
  911.       {
  912.          return undefined;
  913.       }
  914.       return this._vp[this._activeVP].isRTMP;
  915.    }
  916.    function get isLive()
  917.    {
  918.       if(this._vp[this._activeVP] == undefined)
  919.       {
  920.          return this._isLive;
  921.       }
  922.       if(this._vpState[this._activeVP].isLiveSet)
  923.       {
  924.          return this._vpState[this._activeVP].isLive;
  925.       }
  926.       return this._vp[this._activeVP].isLive;
  927.    }
  928.    function set isLive(flag)
  929.    {
  930.       if(this._activeVP == 0 || this._activeVP == undefined)
  931.       {
  932.          this._isLive = flag;
  933.       }
  934.       this._vpState[this._activeVP].isLive = flag;
  935.       this._vpState[this._activeVP].isLiveSet = true;
  936.    }
  937.    function get maintainAspectRatio()
  938.    {
  939.       if(this._vp[this._activeVP] == undefined)
  940.       {
  941.          return this._aspectRatio;
  942.       }
  943.       return this._vp[this._activeVP].maintainAspectRatio;
  944.    }
  945.    function set maintainAspectRatio(flag)
  946.    {
  947.       if(this._activeVP == 0 || this._activeVP == undefined)
  948.       {
  949.          this._aspectRatio = flag;
  950.       }
  951.       this._vp[this._activeVP].maintainAspectRatio = flag;
  952.    }
  953.    function get metadata()
  954.    {
  955.       if(this._vp[this._activeVP] == undefined)
  956.       {
  957.          return null;
  958.       }
  959.       return this._vp[this._activeVP].metadata;
  960.    }
  961.    function get metadataLoaded()
  962.    {
  963.       if(this._vp[this._activeVP] == undefined)
  964.       {
  965.          return false;
  966.       }
  967.       return this._cpMgr[this._activeVP].metadataLoaded;
  968.    }
  969.    function get muteButton()
  970.    {
  971.       if(this._uiMgr != null)
  972.       {
  973.          this._muteButton = this._uiMgr.getControl(mx.video.UIManager.MUTE_BUTTON);
  974.       }
  975.       return this._muteButton;
  976.    }
  977.    function set muteButton(s)
  978.    {
  979.       this._muteButton = s;
  980.       if(this._uiMgr != null)
  981.       {
  982.          this._uiMgr.setControl(mx.video.UIManager.MUTE_BUTTON,s);
  983.       }
  984.    }
  985.    function get ncMgr()
  986.    {
  987.       if(this._vp[this._activeVP] == undefined)
  988.       {
  989.          return null;
  990.       }
  991.       return this._vp[this._activeVP].ncMgr;
  992.    }
  993.    function get pauseButton()
  994.    {
  995.       if(this._uiMgr != null)
  996.       {
  997.          this._pauseButton = this._uiMgr.getControl(mx.video.UIManager.PAUSE_BUTTON);
  998.       }
  999.       return this._pauseButton;
  1000.    }
  1001.    function set pauseButton(s)
  1002.    {
  1003.       this._pauseButton = s;
  1004.       if(this._uiMgr != null)
  1005.       {
  1006.          this._uiMgr.setControl(mx.video.UIManager.PAUSE_BUTTON,s);
  1007.       }
  1008.    }
  1009.    function get paused()
  1010.    {
  1011.       if(this._vp[this._activeVP] == undefined)
  1012.       {
  1013.          return false;
  1014.       }
  1015.       return this._vp[this._activeVP].state == mx.video.FLVPlayback.PAUSED;
  1016.    }
  1017.    function get playButton()
  1018.    {
  1019.       if(this._uiMgr != null)
  1020.       {
  1021.          this._playButton = this._uiMgr.getControl(mx.video.UIManager.PLAY_BUTTON);
  1022.       }
  1023.       return this._playButton;
  1024.    }
  1025.    function set playButton(s)
  1026.    {
  1027.       this._playButton = s;
  1028.       if(this._uiMgr != null)
  1029.       {
  1030.          this._uiMgr.setControl(mx.video.UIManager.PLAY_BUTTON,s);
  1031.       }
  1032.    }
  1033.    function get playheadTime()
  1034.    {
  1035.       if(this._vp[this._activeVP] == undefined)
  1036.       {
  1037.          return 0;
  1038.       }
  1039.       return this._vp[this._activeVP].playheadTime;
  1040.    }
  1041.    function set playheadTime(position)
  1042.    {
  1043.       this.seek(position);
  1044.    }
  1045.    function get playheadUpdateInterval()
  1046.    {
  1047.       if(this._vp[this._activeVP] == undefined)
  1048.       {
  1049.          return this._playheadUpdateInterval;
  1050.       }
  1051.       return this._vp[this._activeVP].playheadUpdateInterval;
  1052.    }
  1053.    function set playheadUpdateInterval(aTime)
  1054.    {
  1055.       if(this._activeVP == 0 || this._activeVP == undefined)
  1056.       {
  1057.          this._playheadUpdateInterval = aTime;
  1058.       }
  1059.       this._cpMgr[this._activeVP].playheadUpdateInterval = aTime;
  1060.       this._vp[this._activeVP].playheadUpdateInterval = aTime;
  1061.    }
  1062.    function get playing()
  1063.    {
  1064.       if(this._vp[this._activeVP] == undefined)
  1065.       {
  1066.          return false;
  1067.       }
  1068.       return this._vp[this._activeVP].state == mx.video.FLVPlayback.PLAYING;
  1069.    }
  1070.    function get playPauseButton()
  1071.    {
  1072.       if(this._uiMgr != null)
  1073.       {
  1074.          this._playPauseButton = this._uiMgr.getControl(mx.video.UIManager.PLAY_PAUSE_BUTTON);
  1075.       }
  1076.       return this._playPauseButton;
  1077.    }
  1078.    function set playPauseButton(s)
  1079.    {
  1080.       this._playPauseButton = s;
  1081.       if(this._uiMgr != null)
  1082.       {
  1083.          this._uiMgr.setControl(mx.video.UIManager.PLAY_PAUSE_BUTTON,s);
  1084.       }
  1085.    }
  1086.    function get preferredHeight()
  1087.    {
  1088.       if(this._vp[this._activeVP] == undefined)
  1089.       {
  1090.          return 0;
  1091.       }
  1092.       return this._vp[this._activeVP].videoHeight;
  1093.    }
  1094.    function get preferredWidth()
  1095.    {
  1096.       if(this._vp[this._activeVP] == undefined)
  1097.       {
  1098.          return 0;
  1099.       }
  1100.       return this._vp[this._activeVP].videoWidth;
  1101.    }
  1102.    function get progressInterval()
  1103.    {
  1104.       if(this._vp[this._activeVP] == undefined)
  1105.       {
  1106.          return this._progressInterval;
  1107.       }
  1108.       return this._vp[this._activeVP].progressInterval;
  1109.    }
  1110.    function set progressInterval(aTime)
  1111.    {
  1112.       if(this._activeVP == 0 || this._activeVP == undefined)
  1113.       {
  1114.          this._progressInterval = aTime;
  1115.       }
  1116.       this._vp[this._activeVP].progressInterval = aTime;
  1117.    }
  1118.    function get scaleX()
  1119.    {
  1120.       if(this._vp[this._visibleVP] != undefined)
  1121.       {
  1122.          this._scaleX = this._vp[this._visibleVP].width / this._origWidth * 100;
  1123.       }
  1124.       return this._scaleX;
  1125.    }
  1126.    function set scaleX(xs)
  1127.    {
  1128.       this.setScale(xs,this.scaleY);
  1129.    }
  1130.    function get scaleY()
  1131.    {
  1132.       if(this._vp[this._visibleVP] != undefined)
  1133.       {
  1134.          this._scaleY = this._vp[this._visibleVP].height / this._origHeight * 100;
  1135.       }
  1136.       return this._scaleY;
  1137.    }
  1138.    function set scaleY(ys)
  1139.    {
  1140.       this.setScale(this.scaleX,ys);
  1141.    }
  1142.    function get scrubbing()
  1143.    {
  1144.       var _loc2_ = this.seekBar;
  1145.       if(_loc2_ == undefined || _loc2_.isDragging == undefined)
  1146.       {
  1147.          return false;
  1148.       }
  1149.       return _loc2_.isDragging;
  1150.    }
  1151.    function get seekBar()
  1152.    {
  1153.       if(this._uiMgr != null)
  1154.       {
  1155.          this._seekBar = this._uiMgr.getControl(mx.video.UIManager.SEEK_BAR);
  1156.       }
  1157.       return this._seekBar;
  1158.    }
  1159.    function set seekBar(s)
  1160.    {
  1161.       this._seekBar = s;
  1162.       if(this._uiMgr != null)
  1163.       {
  1164.          this._uiMgr.setControl(mx.video.UIManager.SEEK_BAR,s);
  1165.       }
  1166.    }
  1167.    function get seekBarInterval()
  1168.    {
  1169.       if(this._uiMgr != null)
  1170.       {
  1171.          this._seekBarInterval = this._uiMgr.seekBarInterval;
  1172.       }
  1173.       return this._seekBarInterval;
  1174.    }
  1175.    function set seekBarInterval(s)
  1176.    {
  1177.       this._seekBarInterval = s;
  1178.       if(this._uiMgr != null)
  1179.       {
  1180.          this._uiMgr.seekBarInterval = this._seekBarInterval;
  1181.       }
  1182.    }
  1183.    function get seekBarScrubTolerance()
  1184.    {
  1185.       if(this._uiMgr != null)
  1186.       {
  1187.          this._seekBarScrubTolerance = this._uiMgr.seekBarScrubTolerance;
  1188.       }
  1189.       return this._seekBarScrubTolerance;
  1190.    }
  1191.    function set seekBarScrubTolerance(s)
  1192.    {
  1193.       this._seekBarScrubTolerance = s;
  1194.       if(this._uiMgr != null)
  1195.       {
  1196.          this._uiMgr.seekBarScrubTolerance = this._seekBarScrubTolerance;
  1197.       }
  1198.    }
  1199.    function get seekToPrevOffset()
  1200.    {
  1201.       return this._seekToPrevOffset;
  1202.    }
  1203.    function set seekToPrevOffset(s)
  1204.    {
  1205.       this._seekToPrevOffset = s;
  1206.    }
  1207.    function get skin()
  1208.    {
  1209.       if(this._uiMgr != null)
  1210.       {
  1211.          this._skin = this._uiMgr.skin;
  1212.       }
  1213.       return this._skin;
  1214.    }
  1215.    function set skin(s)
  1216.    {
  1217.       this._skin = s;
  1218.       if(this._uiMgr != null)
  1219.       {
  1220.          this._uiMgr.skin = s;
  1221.       }
  1222.    }
  1223.    function get skinAutoHide()
  1224.    {
  1225.       if(this._uiMgr != null)
  1226.       {
  1227.          this._skinAutoHide = this._uiMgr.skinAutoHide;
  1228.       }
  1229.       return this._skinAutoHide;
  1230.    }
  1231.    function set skinAutoHide(b)
  1232.    {
  1233.       if(_global.isLivePreview)
  1234.       {
  1235.          return;
  1236.       }
  1237.       this._skinAutoHide = b;
  1238.       if(this._uiMgr != null)
  1239.       {
  1240.          this._uiMgr.skinAutoHide = b;
  1241.       }
  1242.    }
  1243.    function get transform()
  1244.    {
  1245.       return this._transform;
  1246.    }
  1247.    function set transform(s)
  1248.    {
  1249.       this._transform = s;
  1250.       if(this._vp[this._activeVP] != undefined)
  1251.       {
  1252.          this._vp[this._activeVP].transform = this._transform;
  1253.       }
  1254.    }
  1255.    function get state()
  1256.    {
  1257.       if(_global.isLivePreview)
  1258.       {
  1259.          return mx.video.FLVPlayback.STOPPED;
  1260.       }
  1261.       if(this._vp[this._activeVP] == undefined)
  1262.       {
  1263.          return mx.video.FLVPlayback.DISCONNECTED;
  1264.       }
  1265.       if(this._activeVP == this._visibleVP && this.scrubbing)
  1266.       {
  1267.          return mx.video.FLVPlayback.SEEKING;
  1268.       }
  1269.       var _loc3_ = this._vp[this._activeVP].state;
  1270.       if(_loc3_ == mx.video.VideoPlayer.RESIZING)
  1271.       {
  1272.          return mx.video.FLVPlayback.LOADING;
  1273.       }
  1274.       if(this._vpState[this._activeVP].prevState == mx.video.FLVPlayback.LOADING && this._vpState[this._activeVP].autoPlay && _loc3_ == mx.video.FLVPlayback.STOPPED)
  1275.       {
  1276.          return mx.video.FLVPlayback.LOADING;
  1277.       }
  1278.       return _loc3_;
  1279.    }
  1280.    function get stateResponsive()
  1281.    {
  1282.       if(this._vp[this._activeVP] == undefined)
  1283.       {
  1284.          return false;
  1285.       }
  1286.       return this._vp[this._activeVP].stateResponsive;
  1287.    }
  1288.    function get stopButton()
  1289.    {
  1290.       if(this._uiMgr != null)
  1291.       {
  1292.          this._stopButton = this._uiMgr.getControl(mx.video.UIManager.STOP_BUTTON);
  1293.       }
  1294.       return this._stopButton;
  1295.    }
  1296.    function set stopButton(s)
  1297.    {
  1298.       this._stopButton = s;
  1299.       if(this._uiMgr != null)
  1300.       {
  1301.          this._uiMgr.setControl(mx.video.UIManager.STOP_BUTTON,s);
  1302.       }
  1303.    }
  1304.    function get stopped()
  1305.    {
  1306.       if(this._vp[this._activeVP] == undefined)
  1307.       {
  1308.          return false;
  1309.       }
  1310.       return this._vp[this._activeVP].state == mx.video.FLVPlayback.STOPPED;
  1311.    }
  1312.    function get totalTime()
  1313.    {
  1314.       if(_global.isLivePreview)
  1315.       {
  1316.          return 1;
  1317.       }
  1318.       if(this._vp[this._activeVP] == undefined)
  1319.       {
  1320.          return this._totalTime;
  1321.       }
  1322.       if(this._vpState[this._activeVP].totalTimeSet)
  1323.       {
  1324.          return this._vpState[this._activeVP].totalTime;
  1325.       }
  1326.       return this._vp[this._activeVP].totalTime;
  1327.    }
  1328.    function set totalTime(aTime)
  1329.    {
  1330.       if(this._activeVP == 0 || this._activeVP == undefined)
  1331.       {
  1332.          this._totalTime = aTime;
  1333.       }
  1334.       this._vpState[this._activeVP].totalTime = aTime;
  1335.       this._vpState[this._activeVP].totalTimeSet = true;
  1336.    }
  1337.    function get version_1_0_2()
  1338.    {
  1339.       return "";
  1340.    }
  1341.    function set version_1_0_2(v)
  1342.    {
  1343.    }
  1344.    function get visible()
  1345.    {
  1346.       return this._visible;
  1347.    }
  1348.    function set visible(v)
  1349.    {
  1350.       this._visible = v;
  1351.    }
  1352.    function get visibleVideoPlayerIndex()
  1353.    {
  1354.       return this._visibleVP;
  1355.    }
  1356.    function set visibleVideoPlayerIndex(i)
  1357.    {
  1358.       if(this._visibleVP == i)
  1359.       {
  1360.          return;
  1361.       }
  1362.       var _loc3_ = this._visibleVP;
  1363.       if(this._vp[i] == undefined)
  1364.       {
  1365.          this.createVideoPlayer(i);
  1366.       }
  1367.       var _loc5_ = this._vp[i].height != this._vp[this._visibleVP].height || this._vp[i].width != this._vp[this._visibleVP].width;
  1368.       this._vp[this._visibleVP].visible = false;
  1369.       this._vp[this._visibleVP].volume = 0;
  1370.       this._visibleVP = i;
  1371.       if(this._firstStreamShown)
  1372.       {
  1373.          this._uiMgr.setupSkinAutoHide();
  1374.          this._vp[this._visibleVP].visible = true;
  1375.          if(!this.scrubbing)
  1376.          {
  1377.             this._vp[this._visibleVP].volume = this._volume;
  1378.          }
  1379.       }
  1380.       else if(this._vp[this._visibleVP].stateResponsive && this._vp[this._visibleVP].state != mx.video.FLVPlayback.DISCONNECTED && this._uiMgr.skinReady)
  1381.       {
  1382.          this._uiMgr.visible = true;
  1383.          this._uiMgr.setupSkinAutoHide();
  1384.          this._firstStreamReady = true;
  1385.          this.showFirstStream();
  1386.       }
  1387.       if(this._vp[_loc3_].height != this._vp[this._visibleVP].height || this._vp[_loc3_].width != this._vp[this._visibleVP].width)
  1388.       {
  1389.          this.dispatchEvent({type:"resize",x:this.x,y:this.y,width:this.width,height:this.height,auto:false,vp:this._visibleVP});
  1390.       }
  1391.       this._uiMgr.handleEvent({type:"stateChange",state:this._vp[this._visibleVP].state,vp:this._visibleVP});
  1392.       this._uiMgr.handleEvent({type:"playheadUpdate",playheadTime:this._vp[this._visibleVP].playheadTime,vp:this._visibleVP});
  1393.       if(this._vp[this._visibleVP].isRTMP)
  1394.       {
  1395.          this._uiMgr.handleEvent({type:"ready",vp:this._visibleVP});
  1396.       }
  1397.       else
  1398.       {
  1399.          this._uiMgr.handleEvent({type:"progress",bytesLoaded:this._vp[this._visibleVP].bytesLoaded,bytesTotal:this._vp[this._visibleVP].bytesTotal,vp:this._visibleVP});
  1400.       }
  1401.    }
  1402.    function get volume()
  1403.    {
  1404.       return this._volume;
  1405.    }
  1406.    function set volume(aVol)
  1407.    {
  1408.       if(this._volume == aVol)
  1409.       {
  1410.          return;
  1411.       }
  1412.       this._volume = aVol;
  1413.       if(!this.scrubbing)
  1414.       {
  1415.          this._vp[this._visibleVP].volume = this._volume;
  1416.       }
  1417.       this.dispatchEvent({type:"volumeUpdate",volume:aVol});
  1418.    }
  1419.    function get volumeBar()
  1420.    {
  1421.       if(this._uiMgr != null)
  1422.       {
  1423.          this._volumeBar = this._uiMgr.getControl(mx.video.UIManager.VOLUME_BAR);
  1424.       }
  1425.       return this._volumeBar;
  1426.    }
  1427.    function set volumeBar(s)
  1428.    {
  1429.       this._volumeBar = s;
  1430.       if(this._uiMgr != null)
  1431.       {
  1432.          this._uiMgr.setControl(mx.video.UIManager.VOLUME_BAR,s);
  1433.       }
  1434.    }
  1435.    function get volumeBarInterval()
  1436.    {
  1437.       if(this._uiMgr != null)
  1438.       {
  1439.          this._volumeBarInterval = this._uiMgr.volumeBarInterval;
  1440.       }
  1441.       return this._volumeBarInterval;
  1442.    }
  1443.    function set volumeBarInterval(s)
  1444.    {
  1445.       this._volumeBarInterval = s;
  1446.       if(this._uiMgr != null)
  1447.       {
  1448.          this._uiMgr.volumeBarInterval = this._volumeBarInterval;
  1449.       }
  1450.    }
  1451.    function get volumeBarScrubTolerance()
  1452.    {
  1453.       if(this._uiMgr != null)
  1454.       {
  1455.          this._volumeBarScrubTolerance = this._uiMgr.volumeBarScrubTolerance;
  1456.       }
  1457.       return this._volumeBarScrubTolerance;
  1458.    }
  1459.    function set volumeBarScrubTolerance(s)
  1460.    {
  1461.       this._volumeBarScrubTolerance = s;
  1462.       if(this._uiMgr != null)
  1463.       {
  1464.          this._uiMgr.volumeBarScrubTolerance = this._volumeBarScrubTolerance;
  1465.       }
  1466.    }
  1467.    function get width()
  1468.    {
  1469.       if(_global.isLivePreview)
  1470.       {
  1471.          return this.__width;
  1472.       }
  1473.       if(this._vp[this._visibleVP] != undefined)
  1474.       {
  1475.          this.__width = this._vp[this._visibleVP].width;
  1476.       }
  1477.       return this.__width;
  1478.    }
  1479.    function set width(w)
  1480.    {
  1481.       this.setSize(w,this.height);
  1482.    }
  1483.    function get x()
  1484.    {
  1485.       return this._x;
  1486.    }
  1487.    function set x(xpos)
  1488.    {
  1489.       this._x = xpos;
  1490.    }
  1491.    function get y()
  1492.    {
  1493.       return this._y;
  1494.    }
  1495.    function set y(ypos)
  1496.    {
  1497.       this._y = ypos;
  1498.    }
  1499.    function createVideoPlayer(index)
  1500.    {
  1501.       if(_global.isLivePreview)
  1502.       {
  1503.          return undefined;
  1504.       }
  1505.       var _loc4_ = this.width;
  1506.       var _loc5_ = this.height;
  1507.       this._vp[index] = mx.video.VideoPlayer(this.attachMovie("VideoPlayer",String(index),mx.video.FLVPlayback.VP_DEPTH_OFFSET + index));
  1508.       this._vp[index].setSize(_loc4_,_loc5_);
  1509.       this._topVP = index;
  1510.       this._vp[index].autoRewind = this._autoRewind;
  1511.       this._vp[index].autoSize = this._autoSize;
  1512.       this._vp[index].bufferTime = this._bufferTime;
  1513.       this._vp[index].idleTimeout = this._idleTimeout;
  1514.       this._vp[index].maintainAspectRatio = this._aspectRatio;
  1515.       this._vp[index].playheadUpdateInterval = this._playheadUpdateInterval;
  1516.       this._vp[index].progressInterval = this._progressInterval;
  1517.       this._vp[index].transform = this._transform;
  1518.       this._vp[index].volume = this._volume;
  1519.       if(index == 0)
  1520.       {
  1521.          this._vpState[index] = {id:index,isLive:this._isLive,isLiveSet:true,totalTime:this._totalTime,totalTimeSet:true,autoPlay:this._autoPlay};
  1522.          if(this._contentPath != null && this._contentPath != undefined && this._contentPath != "")
  1523.          {
  1524.             this._vp[index].onEnterFrame = mx.utils.Delegate.create(this,this.doContentPathConnect);
  1525.          }
  1526.       }
  1527.       else
  1528.       {
  1529.          this._vpState[index] = {id:index,isLive:false,isLiveSet:true,totalTime:0,totalTimeSet:true,autoPlay:false};
  1530.       }
  1531.       this._vp[index].addEventListener("resize",this);
  1532.       this._vp[index].addEventListener("close",this);
  1533.       this._vp[index].addEventListener("complete",this);
  1534.       this._vp[index].addEventListener("cuePoint",this);
  1535.       this._vp[index].addEventListener("playheadUpdate",this);
  1536.       this._vp[index].addEventListener("progress",this);
  1537.       this._vp[index].addEventListener("metadataReceived",this);
  1538.       this._vp[index].addEventListener("stateChange",this);
  1539.       this._vp[index].addEventListener("ready",this);
  1540.       this._vp[index].addEventListener("rewind",this);
  1541.       this._cpMgr[index] = new mx.video.CuePointManager(this,index);
  1542.       this._cpMgr[index].playheadUpdateInterval = this._playheadUpdateInterval;
  1543.    }
  1544.    function createUIManager()
  1545.    {
  1546.       this._uiMgr = new mx.video.UIManager(this);
  1547.       this._uiMgr.visible = false;
  1548.       if(this._backButton != null)
  1549.       {
  1550.          this._uiMgr.setControl(mx.video.UIManager.BACK_BUTTON,this._backButton);
  1551.       }
  1552.       if(this._bufferingBar != null)
  1553.       {
  1554.          this._uiMgr.setControl(mx.video.UIManager.BUFFERING_BAR,this._bufferingBar);
  1555.       }
  1556.       this._uiMgr.bufferingBarHidesAndDisablesOthers = this._bufferingBarHides;
  1557.       if(this._forwardButton != null)
  1558.       {
  1559.          this._uiMgr.setControl(mx.video.UIManager.FORWARD_BUTTON,this._forwardButton);
  1560.       }
  1561.       if(this._pauseButton != null)
  1562.       {
  1563.          this._uiMgr.setControl(mx.video.UIManager.PAUSE_BUTTON,this._pauseButton);
  1564.       }
  1565.       if(this._playButton != null)
  1566.       {
  1567.          this._uiMgr.setControl(mx.video.UIManager.PLAY_BUTTON,this._playButton);
  1568.       }
  1569.       if(this._playPauseButton != null)
  1570.       {
  1571.          this._uiMgr.setControl(mx.video.UIManager.PLAY_PAUSE_BUTTON,this._playPauseButton);
  1572.       }
  1573.       if(this._stopButton != null)
  1574.       {
  1575.          this._uiMgr.setControl(mx.video.UIManager.STOP_BUTTON,this._stopButton);
  1576.       }
  1577.       if(this._seekBar != null)
  1578.       {
  1579.          this._uiMgr.setControl(mx.video.UIManager.SEEK_BAR,this._seekBar);
  1580.       }
  1581.       if(this._seekBarInterval != null)
  1582.       {
  1583.          this._uiMgr.seekBarInterval = this._seekBarInterval;
  1584.       }
  1585.       if(this._seekBarScrubTolerance != null)
  1586.       {
  1587.          this._uiMgr.seekBarScrubTolerance = this._seekBarScrubTolerance;
  1588.       }
  1589.       if(this._skin != null)
  1590.       {
  1591.          this._uiMgr.skin = this._skin;
  1592.       }
  1593.       if(this._skinAutoHide != null)
  1594.       {
  1595.          this._uiMgr.skinAutoHide = this._skinAutoHide;
  1596.       }
  1597.       if(this._muteButton != null)
  1598.       {
  1599.          this._uiMgr.setControl(mx.video.UIManager.MUTE_BUTTON,this._muteButton);
  1600.       }
  1601.       if(this._volumeBar != null)
  1602.       {
  1603.          this._uiMgr.setControl(mx.video.UIManager.VOLUME_BAR,this._volumeBar);
  1604.       }
  1605.       if(this._volumeBarInterval != null)
  1606.       {
  1607.          this._uiMgr.volumeBarInterval = this._volumeBarInterval;
  1608.       }
  1609.       if(this._volumeBarScrubTolerance != null)
  1610.       {
  1611.          this._uiMgr.volumeBarScrubTolerance = this._volumeBarScrubTolerance;
  1612.       }
  1613.    }
  1614.    function createLivePreviewMovieClip()
  1615.    {
  1616.       this.preview_mc = this.createEmptyMovieClip("preview_mc",10);
  1617.       this.preview_mc.createEmptyMovieClip("box_mc",10);
  1618.       this.preview_mc.box_mc.beginFill(0);
  1619.       this.preview_mc.box_mc.moveTo(0,0);
  1620.       this.preview_mc.box_mc.lineTo(0,100);
  1621.       this.preview_mc.box_mc.lineTo(100,100);
  1622.       this.preview_mc.box_mc.lineTo(100,0);
  1623.       this.preview_mc.box_mc.lineTo(0,0);
  1624.       this.preview_mc.box_mc.endFill();
  1625.       this.preview_mc.attachMovie("Icon","icon_mc",20);
  1626.    }
  1627.    function doContentPathConnect()
  1628.    {
  1629.       delete this._vp[0].onEnterFrame;
  1630.       this._vp[0].onEnterFrame = undefined;
  1631.       if(_global.isLivePreview)
  1632.       {
  1633.          return undefined;
  1634.       }
  1635.       if(this._vpState[0].autoPlay && this._firstStreamShown)
  1636.       {
  1637.          this._vp[0].play(this._contentPath,this._isLive,this._totalTime);
  1638.       }
  1639.       else
  1640.       {
  1641.          this._vp[0].load(this._contentPath,this._isLive,this._totalTime);
  1642.       }
  1643.       this._vpState[0].isLiveSet = false;
  1644.       this._vpState[0].totalTimeSet = false;
  1645.    }
  1646.    function showFirstStream()
  1647.    {
  1648.       this._firstStreamShown = true;
  1649.       this._vp[this._visibleVP].visible = true;
  1650.       if(!this.scrubbing)
  1651.       {
  1652.          this._vp[this._visibleVP].volume = this._volume;
  1653.       }
  1654.       var _loc2_ = 0;
  1655.       while(_loc2_ < this._vp.length)
  1656.       {
  1657.          if(this._vp[_loc2_] != undefined && this._vp[_loc2_].state == mx.video.FLVPlayback.STOPPED && this._vpState[_loc2_].autoPlay)
  1658.          {
  1659.             this._vp[_loc2_].play();
  1660.          }
  1661.          _loc2_ = _loc2_ + 1;
  1662.       }
  1663.    }
  1664.    function _scrubStart()
  1665.    {
  1666.       var _loc2_ = this.playheadTime;
  1667.       this._vp[this._visibleVP].volume = 0;
  1668.       this.dispatchEvent({type:"stateChange",state:mx.video.FLVPlayback.SEEKING,playheadTime:_loc2_,vp:this._visibleVP});
  1669.       this.dispatchEvent({type:"scrubStart",state:mx.video.FLVPlayback.SEEKING,playheadTime:_loc2_});
  1670.    }
  1671.    function _scrubFinish()
  1672.    {
  1673.       var _loc3_ = this.playheadTime;
  1674.       var _loc2_ = this.state;
  1675.       this._vp[this._visibleVP].volume = this._volume;
  1676.       if(_loc2_ != mx.video.FLVPlayback.SEEKING)
  1677.       {
  1678.          this.dispatchEvent({type:"stateChange",state:_loc2_,playheadTime:_loc3_,vp:this._visibleVP});
  1679.       }
  1680.       this.dispatchEvent({type:"scrubFinish",state:_loc2_,playheadTime:_loc3_});
  1681.    }
  1682.    function skinError(message)
  1683.    {
  1684.       if(this._firstStreamReady && !this._firstStreamShown)
  1685.       {
  1686.          this.showFirstStream();
  1687.       }
  1688.       this.dispatchEvent({type:"skinError",message:message});
  1689.    }
  1690.    function skinLoaded()
  1691.    {
  1692.       if(this._firstStreamReady)
  1693.       {
  1694.          this._uiMgr.visible = true;
  1695.          if(!this._firstStreamShown)
  1696.          {
  1697.             this.showFirstStream();
  1698.          }
  1699.       }
  1700.       else if(this._contentPath == null || this._contentPath == "")
  1701.       {
  1702.          this._uiMgr.visible = true;
  1703.       }
  1704.       this.dispatchEvent({type:"skinLoaded"});
  1705.    }
  1706. }
  1707.